Integrand size = 15, antiderivative size = 64 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=\frac {e^{2 i a}}{x \left (e^{2 i a}-x^2\right )}-\frac {3 x}{e^{2 i a}-x^2}-2 e^{-i a} \text {arctanh}\left (e^{-i a} x\right ) \]
[Out]
Time = 0.08 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4592, 456, 473, 393, 213} \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=-2 e^{-i a} \text {arctanh}\left (e^{-i a} x\right )-\frac {3 x}{-x^2+e^{2 i a}}+\frac {e^{2 i a}}{x \left (-x^2+e^{2 i a}\right )} \]
[In]
[Out]
Rule 213
Rule 393
Rule 456
Rule 473
Rule 4592
Rubi steps \begin{align*} \text {integral}& = \int \frac {\left (-i-\frac {i e^{2 i a}}{x^2}\right )^2}{\left (1-\frac {e^{2 i a}}{x^2}\right )^2 x^2} \, dx \\ & = \int \frac {\left (-i e^{2 i a}-i x^2\right )^2}{x^2 \left (-e^{2 i a}+x^2\right )^2} \, dx \\ & = \frac {e^{2 i a}}{x \left (e^{2 i a}-x^2\right )}-e^{-2 i a} \int \frac {5 e^{4 i a}+e^{2 i a} x^2}{\left (-e^{2 i a}+x^2\right )^2} \, dx \\ & = \frac {e^{2 i a}}{x \left (e^{2 i a}-x^2\right )}-\frac {3 x}{e^{2 i a}-x^2}+2 \int \frac {1}{-e^{2 i a}+x^2} \, dx \\ & = \frac {e^{2 i a}}{x \left (e^{2 i a}-x^2\right )}-\frac {3 x}{e^{2 i a}-x^2}-2 e^{-i a} \text {arctanh}\left (e^{-i a} x\right ) \\ \end{align*}
Time = 0.09 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.12 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=\frac {1}{x}-2 \text {arctanh}(x (\cos (a)-i \sin (a))) \cos (a)+2 i \text {arctanh}(x (\cos (a)-i \sin (a))) \sin (a)+\frac {2 x (\cos (a)-i \sin (a))}{\left (-1+x^2\right ) \cos (a)-i \left (1+x^2\right ) \sin (a)} \]
[In]
[Out]
Time = 2.10 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.59
method | result | size |
risch | \(\frac {1}{x}-\frac {2}{x \left (\frac {{\mathrm e}^{2 i a}}{x^{2}}-1\right )}-2 \,\operatorname {arctanh}\left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{-i a}\) | \(38\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.16 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=-\frac {{\left (x^{3} - x e^{\left (2 i \, a\right )}\right )} e^{\left (-i \, a\right )} \log \left (x + e^{\left (i \, a\right )}\right ) - {\left (x^{3} - x e^{\left (2 i \, a\right )}\right )} e^{\left (-i \, a\right )} \log \left (x - e^{\left (i \, a\right )}\right ) - 3 \, x^{2} + e^{\left (2 i \, a\right )}}{x^{3} - x e^{\left (2 i \, a\right )}} \]
[In]
[Out]
Time = 0.21 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.72 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=- \frac {- 3 x^{2} + e^{2 i a}}{x^{3} - x e^{2 i a}} - \left (- \log {\left (x - e^{i a} \right )} + \log {\left (x + e^{i a} \right )}\right ) e^{- i a} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 276 vs. \(2 (50) = 100\).
Time = 0.22 (sec) , antiderivative size = 276, normalized size of antiderivative = 4.31 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=-\frac {2 \, {\left ({\left (i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + {\left (i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right )\right )} x^{3} + 2 \, {\left ({\left ({\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + {\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + {\left ({\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + {\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right )\right )} x - 6 \, x^{2} + {\left (x^{3} {\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} - {\left ({\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + {\left (i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} x\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) - {\left (x^{3} {\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} - {\left ({\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \cos \left (2 \, a\right ) - {\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} x\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) + 2 \, \cos \left (2 \, a\right ) + 2 i \, \sin \left (2 \, a\right )}{2 \, {\left (x^{3} - x {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )}\right )}} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.36 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=2 \, {\left (\frac {\arctan \left (\frac {x}{\sqrt {-e^{\left (2 i \, a\right )}}}\right ) e^{\left (-2 i \, a\right )}}{\sqrt {-e^{\left (2 i \, a\right )}}} + \frac {x e^{\left (-2 i \, a\right )}}{x^{2} - e^{\left (2 i \, a\right )}}\right )} e^{\left (2 i \, a\right )} + \frac {5 \, x^{2}}{x^{3} - x e^{\left (2 i \, a\right )}} - \frac {e^{\left (2 i \, a\right )}}{x^{3} - x e^{\left (2 i \, a\right )}} \]
[In]
[Out]
Time = 27.47 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.73 \[ \int \frac {\cot ^2(a+i \log (x))}{x^2} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {x}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}-\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}}-3\,x^2}{x^3-x\,{\mathrm {e}}^{a\,2{}\mathrm {i}}} \]
[In]
[Out]